<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>自定义设置界面</title>
    <script src="init.js?from=antd"></script>
    <style>
        #app{
            width: 800px;
            margin: auto;
        }
    </style>
</head>
<body>
<div id="app">
    <a-card title="自定义设置" style="width:100%;">
        <a-form-model layout="horizontal" :model="form" :label-col="{ span: 6 }" :wrapper-col="{ span: 12 }">
            <a-form-model-item label="密码" prop="password">
                <a-input v-model="form.password" placeholder="请输入密码" type="text" />
            </a-form-model-item>
            <a-row>
                <a-col span="10" style="left:10px;">
                    桌面设置
                </a-col>
            </a-row>
            <a-form-model-item label="屏蔽左侧竖条" prop="leftst">
                <a-switch v-model="form.leftst"></a-switch>
            </a-form-model-item>
            <a-form-model-item label="屏蔽底部风车" prop="bottomfc">
                <a-switch v-model="form.bottomfc"></a-switch>
            </a-form-model-item>
            <a-form-model-item label="屏蔽底部感叹号" prop="bottomgth">
                <a-switch v-model="form.bottomgth"></a-switch>
            </a-form-model-item>
            <a-form-model-item label="左下角图标风格" prop="bottomictype">
                <a-radio-group default-value="biaozhun" v-model="form.bottomictype" button-style="solid">
                    <a-radio-button value="biaozhun">
                        标准
                    </a-radio-button>
                    <a-radio-button value="jiaoxiao">
                        较小
                    </a-radio-button>
                    <a-radio-button value="zuixiao">
                        最小
                    </a-radio-button>
                </a-radio-group>
            </a-form-model-item>
            <a-form-model-item label="左下角图标" prop="bottomicon">
                <a-radio-group default-value="default" v-model="form.bottomicon" button-style="solid">
                    <a-radio-button value="default">
                        头像
                    </a-radio-button>
                    <a-radio-button value="win7">
                        Win7
                    </a-radio-button>
                    <a-radio-button value="win10">
                        Win10
                    </a-radio-button>
                </a-radio-group>
            </a-form-model-item>
            <a-form-model-item :wrapper-col="{ span: 18, offset: 10 }">
                <a-button type="primary" @click="saveConfig()">
                    保存
                </a-button>
            </a-form-model-item>
        </a-form-model>
    </a-card>
</div>
</body>
<script>
    Vue.app({
        data:{
            form:{

            }
        },
        methods:{
            saveConfig:function(){
                utils.$.post("/php/action.php?type=1",this.form,function (res){
                    utils.$.successMsg(res.msg);
                });
            },
            getConfig:function (){
                var that = this;
                utils.$.get("/php/action.php?type=0",function (res){
                    if(res.flag){
                        that.form = res.data;
                    }
                },true);
            },
            initData:function (){
                this.getConfig();
            }
        },
        mounted:function(){
            this.initData();
        }
    });
</script>
</html>